package com.pg_chat.exception;

import com.pg_chat.constant.ResponseCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class JsonException extends RuntimeException {
    private Integer code;
    private String message;

    public JsonException(ResponseCode code) {
        super(code.getMessage());
        this.code = code.getCode();
        this.message = code.getMessage();
    }

    public JsonException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}
